<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="Shared.xaml" />
  </ResourceDictionary.MergedDictionaries>


  <Style x:Key="GridViewColumnHeaderGripper" TargetType="{x:Type Thumb}">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Canvas.Right" Value="-9"/>
    <Setter Property="Width" Value="18"/>
    <Setter Property="Height" Value="{Binding Path=ActualHeight,RelativeSource={RelativeSource TemplatedParent}}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border Padding="0,3,0,3">
            <Rectangle 
              HorizontalAlignment="Center"
              Width="1"
              Fill="{StaticResource LightBorderBrush}"/>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Type GridViewColumnHeader}" TargetType="{x:Type GridViewColumnHeader}">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="MinHeight" Value="20" />
    <Setter Property="MinWidth" Value="10" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
          <Grid>
            <Border Name="Border">
              <ContentPresenter 
                Margin="6,2,6,2"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                RecognizesAccessKey="True"/>
            </Border>
            <Canvas>
              <Thumb 
                Name="PART_HeaderGripper"
                Style="{StaticResource GridViewColumnHeaderGripper}" />
            </Canvas>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="Role" Value="Floating">
              <Setter Property="Opacity" Value="0.75"/>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
              <Setter TargetName="PART_HeaderGripper" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


  <Style x:Key="{x:Static GridView.GridViewItemContainerStyleKey}" TargetType="{x:Type ListViewItem}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ListViewItem}">
          <Border Name="Bd"
            Background="Green"
            BorderBrush="{TemplateBinding BorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}"
            Padding="{TemplateBinding Padding}"
            SnapsToDevicePixels="true">
            <GridViewRowPresenter 
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="true">
              <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="true"/>
                <Condition Property="Selector.IsSelectionActive"
                       Value="false"/>
              </MultiTrigger.Conditions>
              <Setter TargetName="Bd"
                  Property="Background"
                  Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
              <Setter Property="Foreground"
                  Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            </MultiTrigger>
            <Trigger Property="IsEnabled"
                 Value="false">
              <Setter Property="Foreground"
                  Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>



  <!-- GridView Style -->

  <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="{x:Type ScrollViewer}">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Focusable" Value="False"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ScrollViewer}">
          <Grid Background="{TemplateBinding Background}">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="*"/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Border 
              Grid.Row="0" 
              BorderThickness="1" 
              Background="{StaticResource LightBrush}" 
              BorderBrush="{StaticResource NormalBorderBrush}">
              <ScrollViewer 
                HorizontalScrollBarVisibility="Hidden"
                VerticalScrollBarVisibility="Hidden"
                Focusable="false">
                <GridViewHeaderRowPresenter 
                  Columns="{Binding Path=View.Columns,RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
                  ColumnHeaderContainerStyle="{Binding Path=View.ColumnHeaderContainerStyle,RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
                  ColumnHeaderTemplate="{Binding Path=View.ColumnHeaderTemplate,RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
                  ColumnHeaderTemplateSelector="{Binding Path=View.ColumnHeaderTemplateSelector,RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
                  AllowsColumnReorder="{Binding Path=View.AllowsColumnReorder,RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
                  ColumnHeaderContextMenu="{Binding Path=View.ColumnHeaderContextMenu,RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
                  ColumnHeaderToolTip="{Binding Path=View.ColumnHeaderToolTip,RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"/>
              </ScrollViewer>
            </Border>
            <Border Grid.Row="1">
              <ScrollContentPresenter 
                Name="PART_ScrollContentPresenter"
                Content="{TemplateBinding Content}"
                ContentTemplate="{TemplateBinding ContentTemplate}"
                CanContentScroll="{TemplateBinding CanContentScroll}"/>
            </Border>
            <ScrollBar Name="PART_HorizontalScrollBar"
              Orientation="Horizontal"
              Grid.Column="0"
              Grid.Row="2"
              Minimum="0.0"
              Maximum="{TemplateBinding ScrollableWidth}"
              ViewportSize="{TemplateBinding ViewportWidth}"
              Value="{Binding Path=HorizontalOffset,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}"
              Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
            <ScrollBar Name="PART_VerticalScrollBar"
              Orientation="Vertical"
              Grid.Column="1"
              Grid.Row="0"
              Grid.RowSpan="2" 
              Minimum="0.0"
              Maximum="{TemplateBinding ScrollableHeight}"
              ViewportSize="{TemplateBinding ViewportHeight}"
              Value="{Binding Path=VerticalOffset,RelativeSource={RelativeSource TemplatedParent},Mode=OneWay}"
              Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


  <Style x:Key="{x:Static GridView.GridViewStyleKey}" TargetType="{x:Type ListView}">
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ListView}">
          <Border Background="Blue" BorderBrush="Aquamarine" BorderThickness="5">
          </Border>          
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>



</ResourceDictionary>